GtkIMContext: Use G_PARAM_EXPLICIT_NOTIFY
authorMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jun 2014 12:59:47 +0000 (08:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jun 2014 17:31:04 +0000 (13:31 -0400)
gtk/gtkimcontext.c

index 5ef5854824ee6374fac388a4e16063f2150cbb55..be0f629a1162c574d2c7a1f23ceb5af2bc5da6ad 100644 (file)
@@ -332,7 +332,7 @@ gtk_im_context_class_init (GtkIMContextClass *klass)
                          P_("Purpose of the text field"),
                          GTK_TYPE_INPUT_PURPOSE,
                          GTK_INPUT_PURPOSE_FREE_FORM,
-                         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+                         G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
 
   properties[PROP_INPUT_HINTS] =
     g_param_spec_flags ("input-hints",
@@ -340,7 +340,7 @@ gtk_im_context_class_init (GtkIMContextClass *klass)
                          P_("Hints for the text field behaviour"),
                          GTK_TYPE_INPUT_HINTS,
                          GTK_INPUT_HINT_NONE,
-                         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+                         G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, LAST_PROPERTY, properties);
 }
@@ -786,10 +786,18 @@ gtk_im_context_set_property (GObject      *obj,
   switch (property_id)
     {
     case PROP_INPUT_PURPOSE:
-      priv->purpose = g_value_get_enum (value);
+      if (priv->purpose != g_value_get_enum (value))
+        {
+          priv->purpose = g_value_get_enum (value);
+          g_object_notify_by_pspec (obj, pspec);
+        }
       break;
     case PROP_INPUT_HINTS:
-      priv->hints = g_value_get_flags (value);
+      if (priv->hints != g_value_get_flags (value))
+        {
+          priv->hints = g_value_get_flags (value);
+          g_object_notify_by_pspec (obj, pspec);
+        }
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);